package com.aaa.hospital.controller;

import com.aaa.hospital.pojo.query.MenuQuery;
import com.aaa.hospital.pojo.vo.MenuVO;
import com.aaa.hospital.result.AjaxResult;
import com.aaa.hospital.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: danghui
 * @Date: 2022/2/22 17:35
 * @Description: TODO
 */
@RestController
@RequestMapping("menu")
public class MenuController {
    @Autowired
    private MenuService menuService;
    @RequestMapping("list")
    public AjaxResult listMenu(MenuQuery query){
        return menuService.listMenu(query);
    }
    @RequestMapping("delete/{id}")
    public AjaxResult deleteMenu(@PathVariable("id") Integer id){
        return menuService.deleteMenu(id);
    }
    @RequestMapping("add")
    public AjaxResult addMenu(MenuVO menuVO){
        return menuService.addMenu(menuVO);
    }
    @RequestMapping("getMenu/{id}")
    public AjaxResult getMenu(@PathVariable("id") Integer id){
        return menuService.getMenu(id);
    }
    @RequestMapping("update")
    public AjaxResult updateMenu(MenuVO menuVO){
        return menuService.updateMenu(menuVO);
    }
}
